package com.wk.wkcomp

import androidx.databinding.DataBindingUtil
import androidx.lifecycle.ViewModelProvider
import com.gyf.immersionbar.ImmersionBar
import com.wk.lib_base.view.BaseActivity
import com.wk.wkcomp.databinding.ActivityTestBinding
import com.wk.wkcomp.model.TestViewModel
import kotlinx.android.synthetic.main.activity_test.*

class TestActivity : BaseActivity() {

    private lateinit var mViewModel: TestViewModel
    private lateinit var mBinding: ActivityTestBinding

    override fun getLayoutId(): Int = R.layout.activity_test
    override fun customImmersion() =
        ImmersionBar.with(this).titleBar(toolbar).autoDarkModeEnable(true).init()

    override fun customContentView() {
        mBinding = DataBindingUtil.setContentView(this, getLayoutId())
    }

    override fun initViews() {
        mViewModel = ViewModelProvider(this)[TestViewModel::class.java]
        mBinding.lifecycleOwner = this
        mBinding.vm = mViewModel

        collaps.setExpandedTitleColor(resources.getColor(R.color.colorPrimary))
        collaps.setCollapsedTitleTextColor(resources.getColor(R.color.colorPrimaryDark))
    }

}
